package com.niit.factory;

public class PhoneFactory {
    // 工厂 生产手机方法
    public static Phone getPhone(String phoneName) {
        if("xiaomi".equals(phoneName)) {
            return new XiaoMiPhone();
        } else if("huawei".equals(phoneName)) {
            return new HuaWeiPhone();
        } else {
            return null;
        }
    }
}
